/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.ui.web;
import java.util.ArrayList;

import org.apache.tapestry.html.BasePage;

import br.ufmg.dees.insane.materialMedia.material.LinearElasticIsotropic;
import br.ufmg.dees.insane.model.femModel.FemModel;
import br.ufmg.dees.insane.model.femModel.node.Node;
/**
*A class to show the result page for the Web Insane Version.
*
*@author Camara, Luciana
*@version 1.0
*@since Julho 2006
*/
public abstract class Result extends BasePage {
//	 Os atributos definidos pelo result.page
		abstract public void setModelo(FemModel mod);
		abstract public FemModel getModelo();
		public String getVao(){
			double vao; ArrayList<Node> nodesList = getModelo().getNodesList();
			double[] coords=new double[nodesList.size()];
			int i=0;
			ArrayList <Node> listaNos = nodesList;			
			for (Node no : listaNos) {
				coords[i]=no.getX(); i++;
			}
			// sabendo que so ha 2 nos
			vao=coords[1]-coords[0]; 
			return String.valueOf(vao);
		}
		
		public String getElast(){			
			LinearElasticIsotropic mat = (LinearElasticIsotropic) getModelo().getMaterialsList().get(0);
			return mat.getMaterialValues().toString();
		}
		
}
